//
// Created by Semir on 2020/4/2.
//

#include<cstdio>
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<queue>
typedef long long ll;
using namespace std;
int n,m,a[105],f[1005];
int main(){
    scanf("%d %d",&n,&m);
    for(int i=1;i<=n;i++)
        scanf("%d",&a[i]);
    f[0]=1;
    cout << f[2] << " " << f[3] << endl;
    for(int i=1;i<=n;i++){
        for(int j=m;j>=a[i];j--){
            f[j]+=f[j-a[i]];
            cout << j << " " << f[j] << endl;
        }
    }
    cout<<f[m];
    return 0;
}